<table class="common-table">
	<thead>
		<tr>
			<th><input id="selectAll" type="checkbox"></th>
			<th>订单号</th>
			<th>收货人</th>
			<th>电话号码</th>
			<th>收货地址</th>
			<th>订单状态</th>
			<th>货物总重(KG)</th>
			<th>总运价(元)</th>
			<th>商品价格(元)</th>
			<th>总价(元)</th>
			<th>修改时间</th>
			<th style="width:50px;">操作</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
		#{if orders}
			#{list items:orders, as:'order'}
			<tr>
				<th><input class="cbItem" type="checkbox" value="${order.id}"></th>
				<td>
					<a href="/admin/order/remittanceConfirm/${order.id}">
					${order.id}
					</a>
				</td>
				<td>${order.receiver}</td>
				<td>${order.phoneNo}</td>
				<td>${order.deliveryAddress}</td>
				<td>
					<span class="important">
						#{if order.orderStatus == models.Order.OrderStatus.NEW}
							新订单
						#{/if}
						#{if order.orderStatus == models.Order.OrderStatus.PAID}
							已付款
						#{/if}
						#{if order.orderStatus == models.Order.OrderStatus.PAY_CONFIRM}
							付款已认
						#{/if}
						#{if order.orderStatus == models.Order.OrderStatus.SENDED}
							已发货
						#{/if}
						#{if order.orderStatus == models.Order.OrderStatus.HISTORY}
							历史订单
						#{/if}
						#{if order.orderStatus == models.Order.OrderStatus.FAIL}
							订单作废
						#{/if}
					</span>
				</td>
				<td>${order.totalWeight}</td>
				<td>${order.totalFreight}</td>
				<td>${order.commodityPrice}</td>
				<td><span class="important">${order.totalPrice}</span></td>
				<td>${order.createAt.format("yyyy-MM-dd hh:mm")}</td>
				<td>
					<a href="/admin/order/show/${order.id}" class="editer">
					[详细]
					</a>
				</td>
				<td>
					<a href="javascript:deleteItem(${order.id})" methods="DELETE" title="删除">
						<img class="minImg" src="@{'public/images/delete.gif'}">
					</a>
				</td>
			</tr>
			#{/list}
		#{/if}
		#{else}
		<tr>
			<td colspan="13">没找到结果。</td>
		</tr>
		#{/else}
	</tbody>
</table>
<div id="pager" style="font-size:1.3em;"></div>
<script language="javascript">
//初始化翻页控件。
function initialPager() {
	$("#pager").pager(
		{
			pagenumber: ${queryBean.currentPage}, 
			pagecount: ${queryBean.totalPage}, 
			totalcount: ${queryBean.totalQuantity},
			buttonClickCallback: PageClick
		}
	);
}
//翻页功能。
function PageClick(pageclickednumber) {
	$("#currentPage").val(pageclickednumber);
	reloadTable();
}
</script>